package com.zrh.jsd.service.studydemo.common_thread;

public class TestThreadDemo extends Thread {
    @Override
    public void run() {
        int i = 0;
        Thread th = Thread.currentThread();
        while(i< 20) {
            if(th.isInterrupted()){
                System.out.println("222222222222=="+th.isInterrupted());
            }else {
                System.out.println("false==============================");
            }
            i++;
        }
    }

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new TestThreadDemo();
        thread.start();
        Thread.sleep(1);
        thread.interrupt();
    }
}
